#pragma once

//-----------------------------------------------------------------------------
// File: GameFramework.h
//-----------------------------------------------------------------------------

#ifndef _GAME_APPLICATION_FRAMEWORK_H_
#define _GAME_APPLICATION_FRAMEWORK_H_

#define FULLSCREEN_WIDTH	640
#define FULLSCREEN_HEIGHT	480

class CGameFramework
{
public:
	CGameFramework(void);
	~CGameFramework(void);

	bool OnCreate(HINSTANCE hInstance, HWND hMainWnd);
	void OnDestroy();
	void FrameAdvance();
	void SetActive(bool bActive) { m_bActive = bActive; }
	void ResetDisplay(bool bChangeDevice, int nClientWidth=0, int nClientHeight=0);

	HINSTANCE					m_hInstance;
	HWND						m_hWnd; 
	HMENU						m_hMenu;

	D3DPRESENT_PARAMETERS BuildPresentParameters();
	void ChangeWindowProperties();

	bool CreateDirect3DDisplay();
	bool BuildObjects();
	void ReleaseObjects();
	void SetupGameState();
	void SetupRenderStates();
	void AnimateObjects();
	void ProcessInput();

	void OnProcessingMouseMessage(HWND hWnd, UINT nMessageID, WPARAM wParam, LPARAM lParam);
	void OnProcessingKeyboardMessage(HWND hWnd, UINT nMessageID, WPARAM wParam, LPARAM lParam);
	LRESULT OnProcessingWindowMessage(HWND hWnd, UINT nMessageID, WPARAM wParam, LPARAM lParam);

	//void OnChangeCamera(ULONG nCameraMode);

	LPDIRECT3D9					m_pD3D;     		// Direct3D Object
	LPDIRECT3DDEVICE9			m_pD3DDevice;		// Direct3D Device Object

	CTimer						m_GameTimer;

	ULONG						m_xViewport;          	
    ULONG						m_yViewport;          	
    ULONG						m_cxViewport;      	
    ULONG						m_cyViewport;     	

	POINT						m_ptOldCursorPos;    

	bool						m_bWindowed;
	bool						m_bLostDevice;      
    bool						m_bActive;          

      

	CScene						*m_pScene;	
};

#endif 

